<?php 
namespace app\index\controller;

use think\Controller;

class Add extends Controller
{
	public function add()
	{
		$data=request()->post();
		$res=model('Ding')->addOne($data);
		if(!$res)
		{
			$arr['code']=1;
			$arr['msg']='添加失败';
			$arr['data']='';
			return json($arr);
		}
		$arr['code']=0;
		$arr['msg']='添加成功';
		$arr['data']='';
		return json($arr);
	}
}
 ?>